package com.example.backend.domain.enums;

/**
 * WebSocket消息类型枚举
 */
public enum WebSocketMessageType {
    
    // 工单相关消息
    TICKET_ASSIGNED("工单分配", "ticket.assigned"),
    TICKET_STATUS_CHANGED("工单状态变更", "ticket.status.changed"),
    TICKET_PRIORITY_CHANGED("工单优先级变更", "ticket.priority.changed"),
    TICKET_UPDATED("工单更新", "ticket.updated"),
    
    // 评论相关消息
    COMMENT_ADDED("新评论", "comment.added"),
    COMMENT_UPDATED("评论更新", "comment.updated"),
    COMMENT_DELETED("评论删除", "comment.deleted"),
    
    // 用户相关消息
    USER_ONLINE("用户上线", "user.online"),
    USER_OFFLINE("用户下线", "user.offline"),
    
    // 系统消息
    SYSTEM_NOTIFICATION("系统通知", "system.notification"),
    SYSTEM_MAINTENANCE("系统维护", "system.maintenance"),
    
    // 错误消息
    ERROR("错误消息", "error"),
    
    // 心跳消息
    PING("心跳检测", "ping"),
    PONG("心跳响应", "pong"),
    
    // 连接消息
    CONNECTION_ESTABLISHED("连接建立", "connection.established"),
    CONNECTION_CLOSED("连接关闭", "connection.closed"),
    
    // 消息确认
    ACK("消息确认", "ack");

    private final String description;
    private final String routingKey;

    WebSocketMessageType(String description, String routingKey) {
        this.description = description;
        this.routingKey = routingKey;
    }

    public String getDescription() {
        return description;
    }

    public String getRoutingKey() {
        return routingKey;
    }
}
